
package cup.modules.visual.dynamic;

/**
 * 数据源常量.
 *
 *
 */
public interface DynamicDataSourceConstant {

	/**
	 * 数据源缓存名
	 */
	String DYNAMIC_DATASOURCE_CACHE = "cup:visual";

	/**
	 * 数据源缓存键
	 */
	String DYNAMIC_DATASOURCE_KEY = "datasource:id:";

	/**
	 * 数据源查询基础
	 */
	String DYNAMIC_DATASOURCE_BASE_STATEMENT = "SELECT id, driver_class as driverClass, url, username, password FROM cup_visual_db";

	/**
	 * 数据源查询SQL
	 */
	String DYNAMIC_DATASOURCE_SINGLE_STATEMENT = DYNAMIC_DATASOURCE_BASE_STATEMENT + " WHERE is_deleted = 0 AND id = ?";

	/**
	 * 数据源查询SQL
	 */
	String DYNAMIC_DATASOURCE_GROUP_STATEMENT = DYNAMIC_DATASOURCE_BASE_STATEMENT + " WHERE is_deleted = 0";

	/**
	 * 数据源错误提示
	 */
	String DYNAMIC_DATASOURCE_NOT_FOUND = "数据源信息有误，数据加载失败";

	/**
	 * oracle驱动类
	 */
	String ORACLE_DRIVER_CLASS = "oracle.jdbc.OracleDriver";

	/**
	 * oracle校验
	 */
	String ORACLE_VALIDATE_STATEMENT = "select 1 from dual";

	/**
	 * 通用校验
	 */
	String COMMON_VALIDATE_STATEMENT = "select 1";

}
